import { createStore } from "vuex";
import { contentPath } from "@/constant/system.js"

export default createStore({
  state: {
    // 登录的用户信息
    userInfo: undefined,
    // token
    token: undefined,
  },
  getters: {

  },
  mutations: {
    // 登录的用户信息
    setUserInfo: (state, val) => {
      state.userInfo = val;
    },
    // 添加token到缓存中
    setToken: (state, val) => {
      state.token = val;
    },
    removeToken: (state) => {
      state.token = undefined;
    },
  },
});
